package com.example.a2032.Utils;

import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Vibrator;
import android.util.Log;

import com.example.a2032.activity.ClockNotifyActivity;
import com.example.a2032.entity.JstyleClock;


public class HeartPackageReceiver extends BroadcastReceiver {

    private NotificationManager notificationManager;
    private static final String TAG = "HeartPackageReceiver";
    private MediaPlayer mediaPlayer;
    private Vibrator vibrator;
    private CharSequence NOTIFICATION_CHANNEL_NAME="Clock";

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub
        ClockUtils.getInstance().setNextHeartPackageClock(context);
        Log.i(TAG, "onReceive: ");
        startLocation();
     //   showClockActivity(context);
    }
    private void startLocation() {
        LocationUtils locationUtils = LocationUtils.getInstance();
        locationUtils.startLocation();
    }
    void showClockActivity(Context context){
        JstyleClock jstyleClock= new JstyleClock();
        jstyleClock.setEnable(true);
        jstyleClock.setHour(5);
        jstyleClock.setMinute(0);
        jstyleClock.setClockType(3);
        Intent intentClock=new Intent(context, ClockNotifyActivity.class);
        intentClock.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intentClock.putExtra(ClockUtils.JSTYLE_CLOCK, jstyleClock);
        context.startActivity(intentClock);
    }




}
